package com.exam.util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import com.mysql.cj.jdbc.result.ResultSetMetaData;

public class DBUtil {
	
	public static Connection getConnection() {
		Connection con = null;		
		try {
			Class.forName("com.mysql.cj.jdbc.Driver");
			con=DriverManager.getConnection(
					"jdbc:mysql://localhost:3306/school?useSSL=false&serverTimezone=UTC"
					,"root","123456");
			
			return con;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
	/*
	 * public static void main(String[] args) { DBUtil bDbUtil=new DBUtil();
	 * System.out.println(bDbUtil.getConnection()); }
	 */
}
